//注册mock.js
import Mock from "mockjs";

Mock.mock('/api/getlunbo', 'get', (data) => {
  // date : Mock.Random.date(),
  // name : Mock.Random.cname(),
  // address : Mock.Random.csentence(5, 15)
  return {
    status: 0 ,
    message: [
      {
        url :"111",
        img :"http://www.pptok.com/wp-content/uploads/2012/08/xunguang-4.jpg",
      },
      {
        url :"222",
        img :"http://img1.imgtn.bdimg.com/it/u=2725262009,4290107754&fm=26&gp=0.jpg",
      }
    ]
  }
});

//获取新闻列表
Mock.mock('/api/getnewslist', 'get', (data) => {
  return {
    status: 0 ,
    message: [
      {
        id:1,
        title:Mock.Random.csentence(10, 15),
        add_time: Mock.Random.date(),
        zhaiyao : Mock.Random.csentence(10, 15),
        click: 1,
        img_url:"http://www.pptok.com/wp-content/uploads/2012/08/xunguang-4.jpg"
      },
      {
        id:2,
        title:Mock.Random.csentence(10, 15),
        add_time: Mock.Random.date(),
        zhaiyao : Mock.Random.csentence(10, 15),
        click: 1,
        img_url:"http://img1.imgtn.bdimg.com/it/u=2725262009,4290107754&fm=26&gp=0.jpg"
      }
    ]
  }
});

//获取新闻详情
Mock.mock('/api/getnew/', 'get', (data) => {
  return {
    status: 0 ,
    message: [
      {
        id:1,
        title:Mock.Random.csentence(10, 15),
        add_time: Mock.Random.date(),
        zhaiyao : Mock.Random.csentence(10, 15),
        click: 1,
        img_url:"http://www.pptok.com/wp-content/uploads/2012/08/xunguang-4.jpg"
      },
      {
        id:2,
        title:Mock.Random.csentence(10, 15),
        add_time: Mock.Random.date(),
        zhaiyao : Mock.Random.csentence(10, 15),
        click: 1,
        img_url:"http://img1.imgtn.bdimg.com/it/u=2725262009,4290107754&fm=26&gp=0.jpg"
      }
    ]
  }
});
